001 /* EVolve - an Extensible Software Visualization Framework 002 * Copyright (C) 2001-2002 Qin Wang 003 * 004 * This library is free software; you can redistribute it and/or 005 * modify it under the terms of the GNU Library General Public 006 * License as published by the Free Software Foundation; either 007 * version 2 of the License, or (at your option) any later version. 008 * 009 * This library is distributed in the hope that it will be useful, 010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 012 * Library General Public License for more details. 013 * 014 * You should have received a copy of the GNU Library General Public 015 * License along with this library; if not, write to the 016 * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 017 * Boston, MA 02111-1307, USA. 018 */ 019 020 /* 021 * EVolve is distributed at http://www.sable.mcgill.ca/EVolve/ 022 */ 023 024 package EVolve.data; 025 026 import EVolve.exceptions.DataProcessingException; 027 import EVolve.exceptions.EVolveException; 028 029 import java.util.HashMap; 030 031 /** 032 * EVolve data source. 033 */ 034 public interface DataSource { 035 /** 036 * Initializes the data source. 037 */ 038 public void init() throws EVolveException; 039 040 /** 041 * Starts building the element definitions. 042 */ 043 public void startBuildDefinition() throws DataProcessingException; 044 045 /** 046 * Gets the next element definition. 047 * 048 * @return next element definition, null if all the definitions are sent. 049 */ 050 public ElementDefinition getNextDefinition() throws DataProcessingException; 051 052 /** 053 * Starts building the entities. 054 */ 055 public void startBuildEntity() throws DataProcessingException; 056 057 /** 058 * Gets the next entity. 059 * 060 * @return next entity, null if all the entities are sent. 061 */ 062 public Entity getNextEntity() throws DataProcessingException; 063 064 /** 065 * Starts building the events. 066 */ 067 public void startBuildEvent() throws DataProcessingException; 068 069 /** 070 * Gets the next event. 071 * 072 * @return next event, null if all the events are sent. 073 */ 074 public Event getNextEvent() throws DataProcessingException; 075 076 /** 077 * Gets the name of the datasource. 078 * 079 * @return data sourse name 080 */ 081 public String getName(); 082 083 /** 084 * Gets the name of the data trace file. 085 * 086 * @return trace file name or null 087 */ 088 public String getFileName(); 089 090 /** 091 * Gets total number of events in the data trace 092 * 093 * @return a long type number containing total number of events 094 */ 095 public long getTotalNumberOfEvents(); 096 097 /** 098 * Gets number of events corresponding event definition name 099 * 100 * @return event number 101 */ 102 public long getNumberOfEvents(String definitionName); 103 104 }